|
|
|
|
|
|
|
operation. After you identify the dataset, you apply the operation to all records in the set. In dataset systems, indexes are used to maintain database integrity more than to speed the location of specific records. |
|
|
|
|
|
|
|
|
Visual Basic and Data Objects |
|
|
|
|
|
|
|
|
Visual Basic database objects are dataset-oriented. Visual Basic programs generally perform better when data operations are done with a dataset than when data operations are done on single records. Some Visual Basic objects work well when performing record-oriented operations; most do not. The Visual Basic table-type Recordset object is very good at performing record-oriented processing. The Visual Basic Dynaset- and snapshot-type Recordset objects do not perform well on record-oriented processes. |
|
|
|
|
|
|
|
|
A common mistake made by database programmers new to Visual Basic is to create programs that assume a record-oriented database model. These programmers are usually frustrated by Visual Basic's slow performance on large data tables and its slow response time when attempting to locate a specific record. Visual Basic's sluggishness is usually due to improper use of Visual Basic data objectsmost often because programmers are opening entire data tables when they only need a small subset of the data in order to perform the required tasks. |
|
|
|
|
|
|
|
|
Dataset Size Affects Program Performance |
|
|
|
|
|
|
|
|
Unlike record-oriented systems, the size of the dataset you create affects the speed at which Visual Basic programs operate. As a data table grows, your program's processing speed can deteriorate. In heavily transaction-oriented applications, such as accounting systems, a dataset can grow quickly and cripple your application's ability to process information. If you are working in a network environment where the machine requesting data and the machine storing the data are separated, sending large datasets over the wire can affect not only your application, but all applications running on the network. For this reason, it is important to keep the size of the datasets as small as possible. This does not mean you have to limit the number of records in your data tables! You can use Visual Basic data objects to select the data you need from the table instead. |
|
|
|
|
|
|
|
|
For example, you might have a data table that contains thousands of accounting transactions. If you want to modify the payment records in the data table, you can create a data object that contains all of the records (quite a big set), or you can tell Visual Basic to select only the payment records (a smaller set). Or, if you know that you only need to modify payment records that have been added to the system in the last three days, you can create an even |
|
|
|
|
|